'''
通讯录页面
'''
from selenium.webdriver.common.by import By

from page_object.base_page import BasePage


class ContactPage(BasePage):
    _base_url = 'https://work.weixin.qq.com/wework_admin/frame#contacts'
    def goto_add_member(self):
        # 解决python循环导包报错的问题，使用场景A-B或者B-A
        from page_object.add_member_page import AddMemberPage
        return AddMemberPage(self.driver)

    def get_list(self):
        res = []
        a = self.driver.find_element(By.CSS_SELECTOR, '.member_colRight_memberTable_tr:nth-child(2)')
        for i in a:
            res.append(i.text)
        return res
